import { useState, useEffect } from 'react';

import Axios from 'axios';
import { Item } from './typing.d';

export const useListVertical = () => {
  const [list, setList] = useState<Item[]>([]);

  useEffect(() => {
    Axios.get<any, Item[]>('/_api/get-list-vertical')
      .then(res => {
        setList(res);
      });
  }, []);

  return list;
};